1. Field of the Invention
The invention relates to video encoding, and in particular to video coding rate control with frame-layer bit allocation.
2. Description of the Related Art
Block-based video coding standards such as MPEG-1/2/4 and H.26x play an important role in the development of video systems, including real-time video coding applications such as video conferencing and offline video coding applications such as video streaming and video in storage medium. In video systems, rate control is very important in that it not only regulates the compressed bit stream but also improves the compressed video quality under various channel and buffer constraints by allocating bits to each coding unit in a rate-distortion (R-D) optimized sense. Different coding units such as macroblock (MB), group of macroblock (GOB) and frame can be used for quality optimization. However, frame-based optimization is most popular and effective, by which target bits are assigned to each frame such that overall distortion is minimized while imposed constraints are satisfied.
Bit allocation methods in video systems deploy a model-based analytical approach or an operational rate and distortion (R-D) based approach to allocate the target bits to each frame in the GOP. The model-based analytical approach utilizes rate and distortion models to estimate R-D characteristics of frames at admissible quantization parameters. The operational R-D based method encodes the frame with a finite set of admissible quantization parameters to obtain corresponding rates and distortions, and determines an optimal quantization parameter according to the actual rates and the actual distortions thereof.
Bit allocation methods can be classified into one-pass and multi-pass ones according to the number of encoding passes of video data. In multi-pass methods, the frames in a GOP are encoded through multiple encoding passes to collect R-D characteristics at different quantization parameters. Multi-pass methods are used for offline video coding applications where encoding delay is not of a concern such as video streaming and video in storage medium. In one-pass methods, R-D characteristics of a set of frames (i.e., GQP) are usually estimated from those of a previous set. One-pass methods are used for real-time encoding applications, where future frames are not available and long encoding delay is not permitted. Even in offline video coding application, one-pass method can be used to reduce encoding complexity.
Two-pass methods, which are kind of multi-pass methods, were disclosed by Y. Yun, J. Zhou, Y. Wang, and C. W. Chen in “A novel two-pass VBR coding algorithm for fixed size storage applications,” IEEE Trans. Circuits and Syst. Video Technol., pp. 345-356, March 2001, and J. Cai, Z. He, C. W. Chen in “Optimal bit allocation for low bit rate video streaming applications,” Proc. IEEE Intl. Conference. Image Processing, pp. 1-73-1-76, May 2004. In the two pass methods, R-D characteristics are collected in the first pass, and frames are finally encoded in the second pass based on the collected R-D characteristics in the first pass. Both two-pass methods determine the optimal number of frame bits assuming that frame is independent of each other.
Exemplary one-pass methods include “A frame-layer bit allocation for H.264+,” IEEE Trans. Circuits and Syst. Video Technol., pp. 1154-1158, October 2000, and “Rate control for an embedded wavelet video coder,” IEEE Trans. Circuits and Syst. Video Technol., vol. 7, pp. 696-702, August 1997. In both exemplary one-path methods, characteristics such as frame energies and/or rate and distortion model parameters of the frames in the current GOP are estimated from those of the previous GOP. For the reason, robustness of these algorithms to various types of sequences cannot be guaranteed.
A need exists for a method and a device for effective rate control with frame-layer bit allocation such that an output bit stream is compatible with the channel bit rate with improved video quality.